By: Dean Tersigni
Last Updated: 2005/09/12


Table of Contents

1.0 Overview
      1.1 Description
      1.2 Toolbar
2.0 Pages
      2.1 Palette
      2.2 Maps
      2.3 Sprites
      2.4 Player
      2.5 Items
      2.6 Conversations
      2.7 Sounds
      2.9 Hacking Tools
      2.10 Misc.
3.0 Configuration Files
4.0 Fail Safes
      4.1 List


1.0 Overview

1.1 Description

The Bionic Commando Editor is a program that will assist you in hacking the ROMs of Bionic Commando and Top Secret. If it ever gets fully completed it will allow you to alter practically every aspect of the game. For now, it only has the ability to alter some of the more basic information.

At current, the BCEditor only supports the Bionic Commando ROM, not the Top Secret ROM. To support both, I simply need to load all the memory offsets from a header file which will allow both ROMs, but I'll worry about that further down the road. Also, the editor checks the size of the ROM and if it doesn't match the proper ROM dump it will fail.

In order to customize the editor to allow for total conversions, most of the editor's information is loaded from configuration files. To learn more about them see the Configuration Files section.

I've tried to make this editor as bulletproof as possible. By doing this, I have limited the user's ability to edit certain things. For information about these things, see the Fail Safes topic.


1.2 Toolbar

Save

BCEditor works by loading the ROM into memory and allowing you to make as many changes as you like. These changes are not saved to disk until you save the ROM. If you quit BCEditor without saving, no changes will be made. There currently isn't a warning message when quitting so be careful!

Save As

Saves the ROM to a new file that you specify.

Open

You won't be able to edit a ROM until you open one. When you open a ROM it is read into memory to allow for editing. If you open another ROM before saving you will lose all changes that you made to the ROM.

Restore

Restoring is a useful feature and very helpful for hacking the ROM. When you open a ROM a backup copy of it is stored in memory. Regardless of how many changes you make to the ROM and how many times you save, the backup remains untouched. At any time you can restore the ROM in memory back to the time you originally opened it. Make sure that after you restore the ROM that you save it when you're done.

This is extremely useful when using the corrupter because if you mess up the ROM, you can instantly fix it by restoring it.

Keep in mind though, that every time you open a ROM, you overwrite the Restore backup. When you quit BCEditor, you lose the backup copy as well.

Help

Opens this document.


2.0 Pages

2.1 Palettes

Palette Information

Bionic Commando has a total of 1664 individual colors, but you won't be able to make use of that many. The NES only supports 64 unique color values, so many of Bionic Commando's colors are the same. A palette consists of 4 colors, making 416 palettes. A palette set consists of 8 palettes, making 52 palette sets. Each map in the game uses a palette set, but several maps can use the same palette set.

Obviously, with these limitations, altering the palette can be a difficult task. You must also remember that the NES can only support 16 unique colors on the screen at once (a palette set), so if you alter the palettes you should keep this in mind. At the moment BCEditor does -not- trap for more than 16 colors in a palette set.

Map Pointers

In Bionic Commando each map targets to a palette set. There are 52 palette sets that consist of 8 palettes, or 32 colors. To alter a map's palette set, click on the map you want to alter in the list. This will refresh the palette set value and show you a preview of how the colors are laid out.

Usually, the top 16 swatches are background and the bottom 16 are sprites, but certain maps change this (Area 3 Exterior for example). There is no way to adjust the order of the palettes, but you can change the actual colors of the palettes themselves.

When you adjust the palette set you will alter -all- of the colors of a map at once. This can give undesired results if you don't plan ahead. Remember that an entire palette set can not contain more than 16 unique colors.

Palettes

Each palette can be altered to a desired color scheme. Keep in mind that when you alter a palette you will be changing it for -every- map that uses that palette. For example, if you change the palette of one neutral zone room, all of them will be change accordingly, because they all share the same palette set.

There is an image of the complete NES color values available to make editing easier.


2.2 Maps

Full map editing may not ever be implemented if Graou's editor is ever finished.

Doors

The door system in Bionic Commando is interesting. Every map has four possible entrance and exit points. Although not each point is a door, we will refer to them as door for simplicity's sake. Each door in a map exits to an entrance door on a different map. This allows every door in the game to target every other door in the game. For example, if you wanted to make the first exit door in Area 1 (the first comm room) exit to the second door in Area 13 you would choose Area 13 as Area 1's first exit door to go to Area 13, and the Entrance door to be a 2.

Music

You can change the music that is played for each map by selecting a map in the list and changing the music in the music section.


2.3 Sprites

Not implemented: This page will allow you to alter how the game sprite tiles are laid out.


2.4 Player

Starting Info

Lives - Straight forward, adjusts the starting live spot in the ROM.

Hit Points - Allows from 0 to 8 hit points. You can actually get more, but the game normally only allows up to 8, so I limited it as well.

Gun - Not fully working. This puts the gun you choose in the gun spot in the selection, but the selected gun you start with is still the rifle.

Communicator - Same as above.


Guns

Bullet Speed - The X and Y speed of a bullet. All values refer to shooting right. The editor automatically mirrors the values for shooting left. The rifle and rocket launcher use the same X,Y, The wide cannon, machine gun, and three-way use the same middle bullet, and the three-way's top and bottom bullets don't have an X speed.

Damage - The amount of damage the weapon does. Note: 3-way and machine gun use the same value as wide cannon.


2.5 Items

Not implemented: This page will allow you to alter the different properties of the items in the game.


2.6 Conversations

Conversation Location

This section will allow you to alter the pointers to the conversations. Altering this will make is possible to change the length of conversations by pointing the other conversations to different offsets. (Not fully implemented)

Conversations

This section will allow you to alter what is said during the existing conversations and what portrait is used. (Not fully implemented)


2.7 Sounds

There are several events in the game that are tied to sounds. When you shoot your weapon a sound is played, when something explodes a sound is played, etc. In this section you can alter which sound is played when that event occurs. As you will notice, some of the events are missing, but they will be added as they're found out. Because of the nature of the NES and saving space, many of the offsets point to the same sound effect making customization a little difficult.

Because sound effects are hard coded in the assembly of the ROM, the hexidecimal offset must be included in the SoundEvents.cfg file. You can change the name of the event, but don't change the hex offsets or you will corrupt the ROM.


2.9 Hacking Tools

This page contains items that will make hacking the ROM for new information much easier.

Corrupter

The corrupter is very useful for finding new information in a ROM. You must pick a starting and ending point, and an optional value to corrupt with. When you save the ROM, the corrupter will overwrite all the bytes in the memory range you specified with the value you chose (By default $EA is used because it is the op code to do nothing). By "breaking" the ROM this way, you can then play the ROM and find out what changes you made. When you're done, simply click the Restore button off the toolbar to reset the ROM. Make sure that you turn off the corrupter before saving if you don't want to corrupt the ROM again.

The Compare check is used to only corrupt bytes in the ROM that match the compare byte. This is useful for finding the location of a value that you already know the amount. For example, if you know the rocket launcher does 3 damage, you can corrupt all the 3's in an area to check for the change.

When you use the corrupter, make sure you clear it out when you're done with it, or you will recorrupt the file when you're done with it.

God Abilities

When testing hacks you will find it useful to be immortal. These options allow you to do just that.

There are two sets of code for determining loss of life and hit points, one for normal play, and one for meet with enemy play (i.e. the sub game). Both checks can be toggled. Also note, instead of spikes doing three damage out right, they actually do 1 + 2 damage. The way the game engine deals damage from spikes is 1 damage is treated as an enemy collision, and then two more for the spikes. So, in order to eliminate spike damage you have to turn off collision damage as well.

Decompiler

This is a primitive 6502 decompiler, but it's useful for figuring out assembly. Enter the starting and ending offsets, and click decompile and you'll get the code a mnemonic layout that is much easier to look at then hex. Because the compiler is so weak it will not discern between code and data so when you start seeing illegal asm code you're most likely in a data block.


Misc.

All other hacking information will go here.


3.0 Configuration Files

In order to make the Bionic Commando Editor more versital it uses configuration files to load information from the ROM. The configuration files are stored in the cfg directory, and have the extension CFG.

These files allow you to change the editor's wording and how information is loaded. For example, you can alter the Guns.cfg file and change the name "Wide Cannon" to "Shotgun" and when you open the editor, all instances of "Wide Cannon" will be changed. This of course, only works for the editor. If you want to change the text in the game, use the conversation page.

When altering a configuration file be sure to observe the existing format. If the values have leading zeroes, use leading zeroes. If there is a hyphen, use a hyphen. I didn't bother making an impressive file parser.

The list of configuration files is as follows:

Alphabet - The alphabet files is a crossover from the BC alphabet to English.
Armor - The names of the three different pieces of armor.
Audio - All the different sound effects and music sequences.
Colors - This is an RGB read out of the NES color palette. It should not be altered.
Communicators - The names of the four different communicators.
Conversations - The location of the conversation spots.
Decompiler - This contains the proper conversion information for decompiling 6502 assembly. It should not be altered.
Guns - The names of the five different guns.
Items - The names of the five different items.
Maps - A name for each map in the game.
Palettes - Contains a description of the game's palettes for easier understanding when editing.
Portraits - The names of the sixteen different face pictures.
Sound Events - Contains the hex offset and a description for all the different events that can play a sound effect.


4.0 Fail Safes

In order to prevent the user from messing up the game, I've added several fail safes in the editor that will limit certain hackable values in the game. If, for some reason, the user needs to circumvent the editor's failsafes, they can simply write to the ROM with a hex editor. However, due to the nature of the editor, if you change some of these beyond the scope of what the editor allows, you may not be able to use the editor any more.

4.1 List

You cannot have a different speed for the bullets for both directions. The editor automatically mirrors the speeds for you. Although having a bullet shoot one speed facing left and a different speed facing right is interesting, I doubt it would be practical in the game.

Bullet speeds are limited to -15 to 15. Anything higher than that causes the bullet to sometimes pass right over an enemy and miss them. As it is, 15 can still pass over certain enemies, so be careful at higher speeds.

Through normal play you cannot get more than 8 hit points. The editor limits at that amount as well. With a hex editor you can get more than 8 hit points but it causes heavy image seperation and the canister count screws up. If you need to start with more than 8 hit points you're probably not good enough to hack the game anyway.